package com.guigu.www.cxk.controller;

import com.guigu.www.cxk.service.CXKInterventionService;
import com.guigu.www.pojo.Intervention;
import com.guigu.www.pojo.TemplateFood;
import com.guigu.www.pojo.TemplateKeep;
import com.guigu.www.pojo.TemplateWholesomeDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("health")
public class CXKInterventionController {

    @Autowired
    CXKInterventionService cxkInterventionService;
    /*查询干预方案表*/
    @PostMapping("{nid}")
    @ResponseBody
    public Intervention LookHealth(@PathVariable int nid){
       return cxkInterventionService.selecthealth(nid);
    }
    /*查询健康干预方案表*/
    @PostMapping("wholesome/{wid}")
    @ResponseBody
    public List<TemplateWholesomeDetails> TempWholesome(@PathVariable int wid){
        return cxkInterventionService.selectWid(wid);
    }
    /*查询运动干预方案表*/
    @PostMapping("keep/{kid}")
    @ResponseBody
    public List<TemplateKeep> TempInner(@PathVariable int kid){
        return cxkInterventionService.selectKid(kid);
    }

    /*查询膳食干预方案*/
    @PostMapping("food/{fid}")
    @ResponseBody
    public List<TemplateFood> TempFood(@PathVariable int fid){
        return cxkInterventionService.selectFid(fid);
    }
}
